package cn.kgc.admin.controller;

import cn.kgc.admin.service.BrandService;
import cn.kgc.common.entity.Brand;
import cn.kgc.common.entity.DataPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BrandController {
    @Autowired
    private BrandService brandService;

    @RequestMapping("/list_brands")
    public DataPage<Brand> listBrand(Integer pageNum, Integer pageSize){
        Integer page = pageNum==null? 1 : pageNum;
        Integer size = pageSize==null? 5 : pageSize;

        return brandService.listBrand(page,size);
    }

}
